<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class CustomerAssignment extends Model
{
	use HasDateTimeFormatter;


    protected $table = 'customer_assignments';

    public $timestamps = false;

    const TYPE = [
        1   =>  '自动分配',
        2   =>  '管理员分配',
        3   =>  '主动领取',
        4   =>  '自动退回',
        5   =>  '主动退回',
    ];

    public function fromUser()
    {
        return $this->belongsTo(User::class,'from_user_id','id');
    }

    public function toUser()
    {
        return $this->belongsTo(User::class,'to_user_id','id');
    }


}
